package com.sxdx.controller;

import com.sxdx.common.Result;
import com.sxdx.entity.LendList;
import com.sxdx.entity.dto.LendListDto;
import com.sxdx.service.ILendListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/library")
public class LendListController {
    @Autowired
    private ILendListService iLendListService;
    /**
     *查看借还记录
     *
     */
    @PostMapping("/lendlist")
    public Result lendlist(LendListDto lendListDto) {
        return iLendListService.getLendList(lendListDto);
    }
    @PostMapping("/lendBook")
    public Result lendBook(LendList lendList) {
        return iLendListService.lendBook(lendList);
    }

    @PostMapping("/returnBook")
    public Result returnBook(LendList lendList) {
        return iLendListService.returnBook(lendList);
    }
}

